package cn.marinda.totipotentwar.global;

import org.bukkit.configuration.ConfigurationSection;

import java.util.HashMap;
import java.util.Map;

/**
 * 排名数据
 *
 * @author hwj
 * @date 2022/01/27
 */
public class RankData extends AbstractPluginConfig{
    private Map<String,Ranks> ranksMap = new HashMap<>();
    /**
     * 摘要插件配置
     *
     *
     */
    public RankData() {
        super("rank");
        defaultData();
    }

    /**
     * 默认数据
     */
    @Override
    protected void defaultData() {
        for(String key : config.getConfigurationSection("rank").getKeys(false)){
            this.ranksMap.put(key,new Ranks(config.getDouble("rank." + key + ".point"),config.getDouble("rank." + key + ".integral")));
        }
    }


    public Map<String, Ranks> getRanksMap() {
        return ranksMap;
    }

    public void setRanksMap(Map<String, Ranks> ranksMap) {
        this.ranksMap = ranksMap;
    }
}
